package com.shiro.serivce.impl;

import com.shiro.maper.UserMapper;
import com.shiro.pojo.User;
import com.shiro.pojo.UserBean;
import com.shiro.serivce.UserSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.sql.DataSource;

@Service
public class UserSerivceimpl implements UserSerivce {
    @Autowired
    private UserMapper userMapper;



    public UserBean getUser(String username) {
        if(username.equals("zhangsan")){
            UserBean user = new UserBean();
            user.setUsername(username);
            user.setPassword("123");
            return user;
        }
        return null;
    }

    @Override
    public UserBean findByUsernamaPassword(String username, String password) {
        return userMapper.findByUsernamaPassword(username,password);
    }

}
